package cn.gudian.cms.sms;
import cn.emay.sdk.client.api.Client;
import cn.gudian.cms.System.Sys;

/**
 * Created by IntelliJ IDEA.
 * User: Administrator
 * Date: 2010-4-2
 * Time: 17:36:29
 * 短信接口类
 */
public class SDKClient {
    private static Client client = null;

    private static String key = Sys.getValue("SMS_SOFTWARESERIALNO");//序列号首次激活时自己设定
    private static String password = Sys.getValue("SMS_PASSWORD");// 密码,请通过亿美销售人员获取

    private SDKClient() {
    }

    public synchronized static Client getClient(String softwareSerialNo, String key) {
        if (client == null) {
            try {
                client = new Client(softwareSerialNo, key);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        return client;
    }

    public synchronized static Client getClient() {

        if (client == null) {
            try {
                client = new Client(key, password);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        return client;
    }

    public static void main(String str[]) {
        SDKClient.getClient();
    }
}

